/**
 * @author Tobias Boehm
 *
 * 24.03.2011
 */
package org.anddev.andengine.extension.tbsengine.scene;

import org.anddev.andengine.entity.scene.Scene;
import org.anddev.andengine.entity.scene.Scene.IOnAreaTouchListener;
import org.anddev.andengine.entity.scene.Scene.ITouchArea;
import org.anddev.andengine.entity.scene.background.ColorBackground;
import org.anddev.andengine.extension.tbsengine.client.AbsInGameActivity;
import org.anddev.andengine.input.touch.TouchEvent;


/**
 * This will be a scene manager.
 * 
 * @author Tobias Boehm
 *
 */
public class SceneManager {
	 
	private final AbsInGameActivity mInGameActivity;
 
	public SceneManager(final AbsInGameActivity pInGameActivity) {
		// context to work with from the main game activity
		this.mInGameActivity = pInGameActivity;
	}
 
	public void loadMain() {
		// create the new scene, with 1 layer
		final Scene scene = new Scene(1);
		scene.setBackground(new ColorBackground(0.09804f, 0.6274f, 0.8784f));
 
        // add some text
       // final Text textCenter = new Text(100, 60, this.mInGameActivity.getFont(), "dis is the 2nd screen", HorizontalAlign.CENTER);
      //  scene.getLastChild().attachChild(textCenter);
 
        scene.setOnAreaTouchListener(new IOnAreaTouchListener() {
					
			@Override
			public boolean onAreaTouched(TouchEvent pSceneTouchEvent,
					ITouchArea pTouchArea, float pTouchAreaLocalX,
					float pTouchAreaLocalY) {
				
				SceneManager.this.mInGameActivity.getCamera().setZoomFactor(2);
				
				return false;
			}
		});
                
        // switch to the new scene
        mInGameActivity.getEngine().setScene(scene);
	}
	
	/*public void loadInGame(final String pMapName){
		
		final Scene inGameScene = new AbsInGameScene(pMapName, this.mInGameActivity);
		
		this.mInGameActivity.getEngine().setScene(inGameScene);
	}*/
}